import React from "react";
import Todo from "./todo/Todo";
import List from "./list/List";
import { useState } from "react";
import ContextTodo,{state} from "../../任俊东/Hooks/context/todoList/contextTodo";
import './style/todulist.scss'

const Todolist =()=> {
  const [list,setList] = useState(state)

  //添加
  let AddTodolist = (msg)=>{
    let lists = {...list}
    lists.todoList.push(msg)
    setList(lists)
  }

    return ( 
    <ContextTodo.Provider value={{...list, AddTodolist}}>
      <div className="warpper">
        <div className="todo">
          <h3>todolist</h3>
            <Todo />
            <List />
        </div>
      </div>
    </ContextTodo.Provider>
     );
}
 
export default Todolist;